package com.eastfair.common.controller.othertomice;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.eastfair.certificate.api.CertificateApiFeign;
import com.eastfair.common.dto.AttachmentFileDTO;
import com.eastfair.common.entity.AttachmentFile;
import com.eastfair.common.vo.CertBlackList;
import com.eastfair.core.base.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassNameLogistics
 * @Description 物流车对接
 * @Authoradmin
 * @Date 2022/12/29 15:50
 * @Version 1.0
 **/

@Slf4j
@Validated
@RestController
@RequestMapping("/logistics")
public class LogisticsController {
    @Resource
    private CertificateApiFeign certificateApiFeign;

    /**
     * 物流车黑名单
     *
     * @param
     * @return
     */
    @PostMapping("/blacklist/sync")
    public R<Boolean> syncBlackLIst(@RequestBody List<CertBlackList> certBlackLists) {
        log.info("物流车黑名单同步:{}", JSONObject.toJSONString(certBlackLists));
        certificateApiFeign.sycnBlackList(certBlackLists);
        return R.success(Boolean.TRUE);
    }

}
